var arr=["./img/image01.png","./img/image02.png","./img/image03.png"]
var index=0
var timer=null
function Pic(){
    document.getElementById("pic").src=arr[index]
    if(index<arr.length-1){
        index++
    }else{
        index=0
    }
    timer=setTimeout("Pic()",2000)
}
window.onload=Pic;

function left(){
    clearTimeout(timer)
    if(index<2){
        index+=(arr.length-2)
    }else{
        index-=2
    }
    document.getElementById("pic").src=arr[index]
    Pic()
}
function right(){
    clearTimeout(timer)
    Pic()
}
function user(){
    var username=document.getElementById("username")
    username.innerHTML=`${localStorage.getItem(username)}`
}

function openCity(evt,name){
    var i ,tab ,tablinks
    tab=document.querySelectorAll(".fade")
    tablinks=document.querySelectorAll(".dyl")
    tablinks.forEach((item,index)=>{
        item.addEventListener("click",function(){
            tab.forEach(i=>{
                i.style.display="none"
            })
            tab[index].style.display='block'
        })
    })

}